package spring.controller;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * project: forum
 * ate: 14-9-4
 * author: wzq
 * description: TODO
 */
@Repository
@SuppressWarnings({"unchecked", "rawtypes"})
public class BoardListDAO {
    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public List<BoardListVo> findAll() {
        Session session = sessionFactory.getCurrentSession();
        List boardLists = session.createQuery("from BoardListVo").list();
        return boardLists;
    }
}
